package com.wuwei.nav.controller;

import com.alibaba.fastjson.JSON;
import com.wuwei.nav.pojo.Nav;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

/**
 * @description: NavController <br>
 * @date: 2021/7/27 14:57 <br>
 * @author: Morning <br>
 * @version: 1.0 <br>
 */
@RestController
@CrossOrigin
public class NavController {

    @GetMapping("/getBtnPerm")
    public Map<String, Object> getBtnPerm(){
        List<String> perms = new LinkedList<>();
        perms.add("sys:role:add");
//        perms.add("sys:role:delete");
//        perms.add("sys:role:update");
        perms.add("sys:role:select");
        Map<String, Object> map = new HashMap<>();
        map.put("status", "perm");
        map.put("perms", perms);
        return map;
    }

    @GetMapping("/getNav")
    public List<Nav> getNav(){
        Nav nav1 = new Nav().setName("home").setTitle("首页").setPath("/home").setComponent("Home").setIcon("iconshouye1");
        Nav nav2 = new Nav().setName("testA").setTitle("企业管理").setPath("/testA").setComponent("TestA").setIcon("iconshouye1");
        Nav nav3 = new Nav().setName("testB").setTitle("财务管理").setPath("/testB").setComponent("TestB").setIcon("iconshouye1");
        Nav nav4 = new Nav().setName("testC").setTitle("产品管理").setPath("/testC").setComponent("TestA").setIcon("iconshouye1");
//        Nav nav5 = new Nav().setName("testD").setTitle("订单管理").setPath("/testD").setComponent("TestA").setIcon("iconshouye1");
        Nav nav6 = new Nav().setName("testE").setTitle("管理会员").setPath("/testE").setComponent("TestA").setIcon("iconshouye1");
        Nav nav7 = new Nav().setName("testF").setTitle("数据概括").setPath("/testF").setComponent("TestA").setIcon("iconshouye1");
        List<Nav> navs = new ArrayList<>();
        navs.add(nav1);
        navs.add(nav2);
        navs.add(nav3);
        navs.add(nav4);
//        navs.add(nav5);
        navs.add(nav6);
        navs.add(nav7);
        return navs;
    }
}
